package com.web.service.BookRack;

import com.web.bean.bookrack.BookRack;
import com.web.dao.bookrack.BookRackDaoImpl;
import com.web.result.Result;

import java.util.List;

/**
 * @autor Chen
 * @create 2021--25-15:56
 * @desc
 */
public class BookRackServiceImpl implements BookRackService {
    Result result =null;
    @Override
    public void addHistoryBookRack(BookRack bookRack) throws Exception {
        BookRackDaoImpl bookRackDao = new BookRackDaoImpl();
        bookRackDao.addBookRack(bookRack);
    }

    @Override
    public List<BookRack> showBookRacks()  throws Exception{
        List<BookRack> bookRacks =null;
        BookRackDaoImpl bookRackDao = new BookRackDaoImpl();
        bookRacks = bookRackDao.bookRacks();
        return bookRacks;
    }

    @Override
    public List<BookRack> showHistoryBookRacks()throws Exception  {
        List<BookRack> bookRacks =null;
        BookRackDaoImpl bookRackDao = new BookRackDaoImpl();
        bookRacks = bookRackDao.hisBook();
        return bookRacks;
    }

    @Override
    public void updateBookRackIn(BookRack bookRack) throws Exception {
        BookRackDaoImpl bookRackDao = new BookRackDaoImpl();
        bookRackDao.updateBookRack(bookRack);
    }

    @Override
    public void updateBookRackOut(BookRack bookRack) throws Exception {
        BookRackDaoImpl bookRackDao = new BookRackDaoImpl();
        bookRackDao.updateBookRack(bookRack);
    }

    @Override
    public void deleteHistoryBookRack(String id) throws Exception {
        BookRackDaoImpl bookRackDao = new BookRackDaoImpl();
        bookRackDao.deleteBookRack(id);
    }
}
